<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    function Persion(name,age,gender){
        this.name=name;
        this.age=age;
        this.gender=gender;

        // this.sayName = fun;
    }

    //将sayName方法在全局作用域中定义
    Persion.prototype.sayName=function(){
        alert("Hello大家好，我是："+this.name);
    }


    var per1 = new Persion("张三",18,"男");
    var per2 = new Persion("李四",20,"女");

    console.log(per1.sayName());

    console.log(per1.sayName == per2.sayName)
</script>

</body>
</html>
